package model;

import java.util.HashMap;

public class Process {
	String id;
	int service;
	int processMoveCost;
	HashMap<String, Integer> requirements;
	String runsOnMachine;

	public Process() {
		requirements = new HashMap<String, Integer>();
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setService(int service_id) {
		this.service = service_id;
	}

	public void addRequirement(String resource, int value) {
		requirements.put(resource, value);
	}

	public void setProcessMoveCost(int x) {
		processMoveCost = x;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(String.format("ID=%s S=%d PMC=%d\n", id, service,
				processMoveCost));
		for (String key : requirements.keySet()) {
			sb.append(String.format("%s->%d\n", key, requirements.get(key)));
		}
		return sb.toString();
	}

	public int getRequirementFor(String r_i_s) {
		return requirements.get(r_i_s);
	}
}
